package com.yusheng.exceptions;

import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * @author Remy
 * @ClassName BizException.java
 * @Description 自定义抛出异常
 * @createTime 2022年11月03日 12:12
 */
@EqualsAndHashCode(callSuper = true)
@Data
public class BizException extends RuntimeException{

    private static final long serialVersionUID = 1L;

    /**
     * 错误码
     */
    protected Integer code;
    /**
     * 错误信息
     */
    protected String message;

    public BizException() {
        super();
    }

    public BizException(BaseErrorInfoInterface errorInfoInterface) {
        super(errorInfoInterface.getCode().toString());
        this.code = errorInfoInterface.getCode();
        this.message = errorInfoInterface.getMsg();
    }
}
